package com.nondo.rdp.finance.model.course;

import com.nondo.rdp.core.common.BeanUtils;
import com.nondo.rdp.core.domain.attach.Attach;
import com.nondo.rdp.core.model.AttachBean;
import com.nondo.rdp.finance.domain.course.Section;
import com.nondo.rdp.finance.domain.course.SectionProcess;


/**
 * 求知-课程-课节-音视频播放进度
 */
public class SectionProcessQuery {
	private Long id; // 主键
	private Long sid;// 课节ID
	private String duration;// 总时长
	private String timePoint; // 当前时间点
	private String name; //课节标题
	private String teacher; // 主讲人
	private AttachBean attach; //音视频

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getSid() {
		return sid;
	}

	public void setSid(Long sid) {
		this.sid = sid;
	}

	public String getDuration() {
		return duration;
	}

	public void setDuration(String duration) {
		this.duration = duration;
	}

	public String getTimePoint() {
		return timePoint;
	}

	public void setTimePoint(String timePoint) {
		this.timePoint = timePoint;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTeacher() {
		return teacher;
	}

	public void setTeacher(String teacher) {
		this.teacher = teacher;
	}

	public AttachBean getAttach() {
		return attach;
	}

	public void setAttach(AttachBean attach) {
		this.attach = attach;
	}

	public static SectionProcessQuery covert2Bean(SectionProcess sectionProcess) {
		SectionProcessQuery sectionProcessQuery = new SectionProcessQuery();
		BeanUtils.copy(sectionProcess, sectionProcessQuery);
		Section section = sectionProcess.getSection();
		sectionProcessQuery.setSid(section.getId());
		sectionProcessQuery.setName(section.getName());
		Attach attach = section.getAttach();
		AttachBean attachBean = AttachBean.covert2Bean(attach);
		sectionProcessQuery.setAttach(attachBean);
		sectionProcessQuery.setTeacher(section.getCourse().getTeacher());
		return sectionProcessQuery;
	}
	
}
